/*
 * @Author: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @Date: 2024-06-20 16:53:44
 * @LastEditors: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @LastEditTime: 2024-06-20 23:22:39
 * @FilePath: \cq-admin-vue3\src\api\check.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
//分页查询
export const getData = (data) => {
  return request({
    url: 'check/getAll',
    method: 'get',
    params: {
      page: data.page,
      pageSize: data.pageSize
    }
  })
}

//搜索
export const searchData = (title) => {
  return request({
    url: 'check/fuzzyQuery',
    method: 'get',
    params: {
      title
    }
  })
}

//根据类别ID查询
export const getDataByCateId = (id) => {
  return request({
    url: `check/category`,
    method: 'get',
    params: {
      categoryId: id
    }
  })
}

export const successOrNot = (data) => {
  return request({
    url: 'check',
    method: 'post',
    data
  })
}

//删除商品
export const del = (id) => {
  return request({
    url: `check/${id}`,
    method: 'delete'
  })
}
